package com.ruoyi.business.controller.itemType;

import com.ruoyi.base.controller.BaseController;
import com.ruoyi.base.enums.type.ItemTypeEnum;
import com.ruoyi.base.pojo.HttpResult;
import com.ruoyi.business.pojo.itemType.ItemTypeDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 项目类型
 */
@Api(tags = "项目类型")
@RestController
@RequestMapping("/itemType")
public class ItemTypeController extends BaseController {
    /**
     * 获取类型列表
     */
    @ApiOperation("获取类型列表")
    @GetMapping("/list")
    public HttpResult<List<ItemTypeDTO>> getTypeList() {
        return data(Arrays.stream(ItemTypeEnum.values()).map(ItemTypeDTO::new).collect(Collectors.toList()));
    }
}
